<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!--#Include Virtual="/expedientes/includes_comun/asp/comun.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sistemas OnLine</title>
<link href="/expedientes/includes_comun/css/general.css" rel="stylesheet" type="text/css" />
<link href="/expedientes/includes_comun/css/usuarios.css" rel="stylesheet" type="text/css" />
<link href="includes/css/sistema.css" rel="stylesheet" type="text/css" />
<script src="includes/js/botones.js" language="javascript" type="text/javascript"></script>
<!--QUEDA PENDIENTE OPCION ADJUNTAR HASTE REALIZAR RELEVAMIENTO O NUEVO SISTEMA  -->
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

</head>

<body>
<div align="center" class="general-central">

<!-- #include file="upload.asp" -->
	<!--#Include Virtual="/expedientes/includes_comun/areas/usuarios.asp"-->
	
	<!--#Include File="includes/areas/cabecera.asp"-->



<%
Dim Uploader, File, id_expediente
Set Uploader = New FileUploader

' This starts the upload process
Uploader.Upload()

'******************************************
' Use [FileUploader object].Form to access 
' additional form variables submitted with
' the file upload(s). (used below)
'******************************************
id_expediente = request.QueryString("expediente")

 %>
 <div class="general-contenido">
            <br><br>
          
		<center>  
    	<%
			If NOT Uploader.Files.Count = 0 Then
				Response.Write "<b>El archivo se adjunto con exito al expediente:  " &id_expediente &""& Uploader.Form("fullname") & "</b><br>"	
			ELSE
				Response.Write "El Archivo no se cargo. Consulte su expediente."
			END IF
		%>
            <br><br>
            <a href="http://localhost/expedientes/sistemas/gae/consultar.asp" title="volver">Consultar</a>
            <br><br>
        </center>
		</div>
    </div>
  </div>
    
</body>
</html>
<%
'response.Write(id_expediente)

' Check if any files were uploaded
If NOT Uploader.Files.Count = 0 Then
	' Loop through the uploaded files
	For Each File In Uploader.Files.Items
		
		' Check where the user wants to save the file
		'If Uploader.Form("saveto") = "disk" Then
	
			' Save the file
			File.SaveToDisk "C:\inetpub\wwwroot\compartir\expedientes\upload"
	
		'ElseIf Uploader.Form("saveto") = "database" Then
			
			' Open the table you are saving the file to
			'Set RS = Server.CreateObject("ADODB.Recordset")
			'RS.Open "MyUploadTable", "CONNECT STRING OR ADO.Connection", 2, 2
			'RS.AddNew ' create a new record
			
'			RS("filename")    = File.FileName
'			RS("filesize")	  = File.FileSize
'			RS("contenttype") = File.ContentType
'		
'			' Save the file to the database
'			File.SaveToDatabase RS("filedata")
'			
'			' Commit the changes and close
'			RS.Update
'			RS.Close
'		End If
		' Output the file details to the browser
		'Response.Write "File Uploaded: " & File.FileName & "<br>"
		'Response.Write "Size: " & File.FileSize & " bytes<br>"
		'Response.Write "Type: " & File.ContentType & "<br><br>"
		'url = response.Write("/expedientes/upload/" & File.FileName)
		Conectar_gae
			SQL = "UPDATE Expedientes SET UrlArchivo = '/expedientes/upload/"&File.FileName&"' WHERE Id_Expediente = '"& id_expediente &"'"
		    'Response.Write(SQL)
			Conexion.Execute(SQL)
		Desconectar
		'MostrarMsg "El Archivo Adjunto del expediente "& Response.Write(id_expediente)" ha sido guardado con exito.", False
				
	Next
	
End If


%>
 

